package com.daify.threadlearn.chapter01.order03;

/**
 * @author daify
 * @date 2019-06-04
 */
public class NoSafeListener {

    private int index;

    private String name;

    public NoSafeListener() throws InterruptedException {
        Thread thread = new Thread(new Runnable() {
            public void run() {
                System.out.println("线程启动");
                Class<? extends Runnable> aClass = this.getClass();
            }
        });

        thread.start();
        Thread.sleep(1000);
        System.out.println("开始赋值");
        this.index = 5;

        this.name = "test";
    }

    public static void main(String[] args) throws InterruptedException {
        NoSafeListener safeListener = new NoSafeListener();
    }
}
